|
RPi Hardware Interface
|
Go to the source code of this file.
Macros | |
| #define | STATUS_BYTE 0x6A |
| #define | COMMAND_GET_CLOCK_SPEED 1 |
| #define | COMMAND_READ_BITMASK 2 |
| #define | COMMAND_NEXT_BITMASK 3 |
| #define | COMMAND_PAUSE 4 |
| #define | COMMAND_UNPAUSE 5 |
| #define | COMMAND_READ_ADC_DATA 6 |
| #define | COMMAND_CLEAR_ADC_DATA 7 |
| #define | COMMAND_RESET 8 |
| #define | COMMAND_ACTIVATE_ADC 10 |
| #define | COMMAND_DEACTIVATE_ADC 11 |
| See COMMAND_ACTIVATE_ADC. More... | |
| #define | COMMAND_GET_QUEUE_SIZE 33 |
| #define | COMMAND_GET_DATA_STORE_SIZE 36 |
| #define | COMMAND_GET_DATA_STORE_USAGE 37 |
| #define COMMAND_ACTIVATE_ADC 10 |
used to turn ADC chips on and off (to preserve them)
SPI MOSI: command byte, unused (15 bytes)
SPI MISO: status byte, unused (15 bytes)
| #define COMMAND_CLEAR_ADC_DATA 7 |
empties all data in the ADC ram
SPI MOSI: command byte, unused (15 bytes)
SPI MISO: status byte, unused (15 bytes)
| #define COMMAND_DEACTIVATE_ADC 11 |
See COMMAND_ACTIVATE_ADC.
| #define COMMAND_GET_CLOCK_SPEED 1 |
Gets the frequency of the FPGA clock
SPI MOSI: command byte, unsused (15 bytes)
SPI MISO: status byte, unused (3 bytes), clock speed in Hz (4 byte integer), unusued (8 bytes)
| #define COMMAND_GET_DATA_STORE_SIZE 36 |
Gets the maximum number of ADC measurements that can be recorded (per channel)
SPI MOSI: command byte, unsused (15 bytes)
SPI MISO: status byte, unused (3 bytes), clock speed in Hz (4 byte integer), unusued (8 bytes)
| #define COMMAND_GET_DATA_STORE_USAGE 37 |
Gets the current number of ADC measurements that have been recorded for each channel SPI MOSI: command byte, unsused (15 bytes) SPI MISO: status byte, unused (1 byte), ADC buffer channel 0 (2 byte integer), ADC buffer channel 1 (2 byte integer), ADC buffer channel 2 (2 byte integer), ADC buffer channel 3 (2 byte integer), unused (6 bytes)
| #define COMMAND_GET_QUEUE_SIZE 33 |
Gets the maximum number bitmasks that fit in the queue
SPI MOSI: command byte, unsused (15 bytes)
SPI MISO: status byte, unused (3 bytes), clock speed in Hz (4 byte integer), unusued (8 bytes)
| #define COMMAND_NEXT_BITMASK 3 |
adds a bitmask to the queue and returns the current bitmask, remaining duration of that bitmask, and the size of the queue
SPI MOSI: command byte, unused (3 bytes), next bitmask (4 bytes), next bitmask duration (4 bytes), unused (4 bytes)
SPI MISO: status byte, unused (3 bytes), current bitmask (4 bytes), current duration (4 byte integer), bitmask queue size (4 byte integer)
| #define COMMAND_PAUSE 4 |
stops the bitmask counter (use before adding several very short bitmasks)
SPI MOSI: command byte, unused (15 bytes)
SPI MISO: status byte, unused (15 bytes)
| #define COMMAND_READ_ADC_DATA 6 |
reads an entry from the ADC data
SPI MOSI: command byte, channel (1 byte), address (2 bytes), unused (12 bytes)
SPI MISO: status byte, unused (11 bytes), data value (4 bytes)
| #define COMMAND_READ_BITMASK 2 |
returns the same information as COMMAND_NEXT_BITMASK, but without adding a bitmask
SPI MOSI: command byte, unused (15 bytes)
SPI MISO: status byte, unused (3 bytes), current bitmask (4 bytes), current duration (4 byte integer), bitmask queue size (4 byte integer)
| #define COMMAND_RESET 8 |
zeroes everything and returns E-TADA to initial state
SPI MOSI: command byte, unused (15 bytes)
SPI MISO: status byte, unused (15 bytes)
| #define COMMAND_UNPAUSE 5 |
starts the bitmask counter
SPI MOSI: command byte, unused (15 bytes)
SPI MISO: status byte, unused (15 bytes)
| #define STATUS_BYTE 0x6A |
The status byte is for testing the SPI connections